package cn.lanqiao.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import cn.lanqiao.entity.Exam_manage;

/**
 * 考试管理
 * @author yejun
 */

@Repository
public interface Exam_manageMapper {

	//展示所有数据
	public List<Exam_manage> listAllExam();
	//分页
	public List<Exam_manage> ExamPages( Map<String,Object> map );
	//获取总记录数
	public int count( String  searchkey );
	//详情查看
	public Exam_manage getExam(Integer examCode);
	//删除
	public int delete(Integer examCode);
	//修改
	public int update(Exam_manage exam);
	//添加
	public int insert(Exam_manage exam);
	//近期考试
	public List<Exam_manage> nearExam();
	
	@Select("select * from exam_manage")
	public List<Exam_manage> findAll();

	@Select("select * from exam_manage")
	public IPage<Exam_manage> findAll(Page page);

	@Select("select * from exam_manage where source = #{source}")
	public Exam_manage findBySource(String source);

	@Select("select paperId from exam_manage order by paperId desc limit 1")
	public Exam_manage findOnlyPaperId();
}
